//package com.qk.management.task;
//
//import cn.hutool.core.bean.BeanUtil;
//import com.qk.common.constant.RedisCacheConstants;
//import com.qk.domain.business.BusinessCountDO;
//import com.qk.domain.clue.ClueCountDO;
//import com.qk.management.annotation.RedisCacheAnnotation;
//import com.qk.management.mapper.BusinessMapper;
//import com.qk.management.mapper.ClueMapper;
//import com.qk.vo.report.OverviewVO;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import java.util.concurrent.TimeUnit;
//
//@Component
//@Slf4j
//public class DataSyncTask {
//    @Autowired
//    private ClueMapper clueMapper;
//    @Autowired
//    private BusinessMapper businessMapper;
//
//
//    @RedisCacheAnnotation(
//            keyPrefix = RedisCacheConstants.CACHE_PORTAL_KEY_PREFIX,
//            expire = 24 * 60,
//            expireTimeUnit = TimeUnit.MINUTES
//    )
//    @Scheduled(cron = "0 30 0 * * ?")// 每天凌晨0:30执行全量同步
//    public OverviewVO dataSyncToRedis() {
//            ClueCountDO clueCountDO = clueMapper.queryClue();
//            BusinessCountDO businessCountDO = businessMapper.queryBusiness();
//            OverviewVO overviewVO = BeanUtil.copyProperties(clueCountDO, OverviewVO.class);
//            BeanUtil.copyProperties(businessCountDO, overviewVO);
//            log.info("查询数据库中的数据: {}, 同步到缓存中", overviewVO);
//            return overviewVO;
//    }
//}